package lambda;

import java.util.Arrays;
import java.util.List;

public class Lambda2 {
    public static void main(String args[]) {
        List<String> alphabets = Arrays.asList("Albany", "Boston", "Charleston ", "Dallas", "Denver", "Detroit");
        System.out.println("Printing with older JDK for loop:");
        for (String str : alphabets) {
            System.out.print(str + "\t");
        }
        System.out.println("\nPrinting with new forEach loop same results:");
        alphabets.forEach(str -> { System.out.print(str + "\t"); });
    }
}
